package com.bean;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Provider {
    /** 供应商id */
    private Integer id;
    /** 供应商编号 */
    private String idName;
    /** 供应商名称 */
    private String providerName;
    /** 供应商联系人 */
    private String phoneName;
    /** 供应商电话 */
    private String phone;
    /** 供应商传真 */
    private String fax;
    /** 供应商日期 */
    private Date date;

    public Provider() {
    }

    public Provider(Integer id) {
        this.id = id;
    }

    public Provider(Integer id, String idName, String providerName) {
        this.id = id;
        this.idName = idName;
        this.providerName = providerName;
    }

    public Provider(String idName, String providerName, String phoneName, String phone, String fax) {
        this.idName = idName;
        this.providerName = providerName;
        this.phoneName = phoneName;
        this.phone = phone;
        this.fax = fax;

        Date date = new Date();
        this.date = date;
    }

    public Provider(Integer id, String idName, String providerName, String phoneName, String phone, String fax, Date date) {
        this.id = id;
        this.idName = idName;
        this.providerName = providerName;
        this.phoneName = phoneName;
        this.phone = phone;
        this.fax = fax;
        this.date = date;
    }

    @Override
    public String toString() {
        return "Provider{" +
                "id=" + id +
                ", idName='" + idName + '\'' +
                ", providerName='" + providerName + '\'' +
                ", phoneName='" + phoneName + '\'' +
                ", phone='" + phone + '\'' +
                ", fax='" + fax + '\'' +
                ", date=" + date +
                '}';
    }

    public String date(){
        return new SimpleDateFormat("yyyy-MM-dd").format(this.date);
    }
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getIdName() {
        return idName;
    }

    public void setIdName(String idName) {
        this.idName = idName;
    }

    public String getProviderName() {
        return providerName;
    }

    public void setProviderName(String providerName) {
        this.providerName = providerName;
    }

    public String getPhoneName() {
        return phoneName;
    }

    public void setPhoneName(String phoneName) {
        this.phoneName = phoneName;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getFax() {
        return fax;
    }

    public void setFax(String fax) {
        this.fax = fax;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }
}
